<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="model.*"%>
<%@ page import="dao.*"%>
<%@ page import="java.util.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("utf-8");
	response.setCharacterEncoding("utf-8");
	String user = (String)session.getAttribute("user");
	if(user!=null && user.equals("1")){
		
	}else {
		response.sendRedirect("Login.jsp");
	}
%>
<%
	List<New> news = new ArrayList<New>();
	news = NewDao.getNews();

	request.setAttribute("news", news);
%>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8" />
<title>管理旅游新闻</title>


<jsp:include page="Header.jsp" flush="true"></jsp:include>


<!-- Latest Products -->
<div id="管理旅游新闻">
	<div class="content-lg container">
		<div class="row margin-b-40">
			<div class="col-sm-6">
				<h2>管理旅游新闻</h2>
				<p></p>
			</div>
		</div>
		<!--// end row -->

		<div class="row">

			<h3>
				<a href="<%=request.getContextPath()%>/admin/AddNew.jsp">添加旅游新闻</a>
			</h3>
			<br>

			<c:forEach var="new1" items="${news}" varStatus="status">
				<div class="container">
					<div class="row clearfix">
						<div class="col-md-12 column">
							<div class="jumbotron">
								<h3>${new1.name }</h3>
								<p>${new1.info }</p>
								<p>
									<a class="btn btn-primary btn-large"
										href="<%=request.getContextPath()%>/NewServlet?handle=delNew&nid=${new1.getId() }">删除</a>
									&nbsp;&nbsp;&nbsp; <a class="btn btn-primary btn-large"
										href="<%=request.getContextPath()%>/admin/UpdateNew.jsp?nid=${new1.getId() }">修改</a> &nbsp;&nbsp;&nbsp;
								</p>
							</div>
						</div>
					</div>
				</div>

			</c:forEach>

		</div>
		<!--// end row -->
	</div>
</div>
<!-- End Latest Products -->

<jsp:include page="Footer.jsp" flush="true"></jsp:include>

<!-- Back To Top -->
<a href="javascript:void(0);" class="js-back-to-top back-to-top">Top</a>

<!-- JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- CORE PLUGINS -->
<script src="vendor/jquery.min.js" type="text/javascript"></script>
<script src="vendor/jquery-migrate.min.js" type="text/javascript"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"
	type="text/javascript"></script>
</body>
<!-- END BODY -->
</html>